package cn.aitstone.org.domain;

import cn.aitstone.basic.domain.BaseDomain;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * @Description: 部门实体类
 * @Author: Sheldon
 * @Version: 1.0
 * @Date:  2022/6/21 19:26  
 */
@Data
public class Department extends BaseDomain {

    // 部门编号
    private String sn;
    // 部门名称
    private String name;
    // 上级部门路径
    private String dirPath;
    // 状态 1启用，0禁用
    private Integer state;
    // 部门管理员
    private Long managerId;
    // 上级部门Id
    private Long parentId;

    private Employee manager;

    private Department parent;

    // 封装子部门集合字段
    @JsonInclude(JsonInclude.Include.NON_EMPTY) // 当数据不为空的时候才返回
    private List<Department> children = new ArrayList<>();
}
